package action

import (
	"core/action"
	"core/auth"
	"core/coredto"
	"core/corestruct"
	"core/myerrors"
	"ht/selfreg"
	"reflect"
)

type GetMenu struct {
}

func (p *GetMenu) Do(ctx *corestruct.HttpContext) (*[]coredto.TreeViewNode, error) {
	var r, err = auth.GetCurrUserMenu(ctx)
	if err != nil {
		return nil, myerrors.NewByErr(err)
	}
	return r, nil
}

func init() {

	var mact = &GetMenu{}
	var maction = action.Action{
		Method: "",

		FullUrl: "/htlogin/GetMenu",
		Name:    "获取菜单",
		Ename:   "",
		Memo:    "",

		PinType:    "",
		PinIslist:  false,
		PoutType:   "",
		PoutIslist: false,
		PoutIspage: false,

		AuthType: action.AuthType_Login,

		LogNeed:     false,
		LogPin:      false,
		LogPout:     false,
		LogTemplete: "",

		PrjName: "",
		Value:   reflect.ValueOf(mact),
	}
	selfreg.AddAction(&maction)

}
